%remove_at(-X,+List,+N,-L)

remove_at(_,[],_,_).
remove_at(X,L1,N,L2):-
    remove_at(X,L1,N,L2,[]).
    
remove_at(H,[H|T],1,L2,Front):-!,
    append(Front,T,L2).
remove_at(X,[H|T],N,L2,Acc):-
    append(Acc,[H],Acc1),
    N1 is N - 1,
    remove_at(X,T,N1,L2,Acc1).
